<template>
  <div class="public">
    <Header @hback="backHome" backText="上一级" title="父组件传来得title" />
    <div class="body">
      <router-view />
    </div>
    <Footer :footerList="footerList"  />
  </div>
</template>

<script lang="ts">
import { Component, Vue } from "vue-property-decorator";
import Header from "@/components/Header.vue";
import Footer from "../components/Footer.vue";

@Component({
  // 注册组件
  components: {
    Header,
    Footer,
  },
})
export default class Home extends Vue {
  // data
  private footerList: any[] = [
    {
      name: "首页",
      path: "/main",
    },
    {
      name: "购物车",
      path: "/shopCar",
    },
    {
      name: "我的",
      path: "/my",
    },
  ];

  private backHome(e) {
    console.log(e, '======')
  }
}
</script>

<style lang="scss" scoped>
.body {
  flex: 1;
  overflow-y: auto;
}
</style>
